﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 创建者模式.factory
{
    public class SimpleFactory
    {
        public static Fruit CreateFruit(string type)
        {
            switch (type)
            {
                case "apple":
                    return new AppleFruit("apple","FS",18,"qing Dao");
                case "pear":
                    return new PearFruit("pear", "ds", 22, "dang Shan");
                default:
                    return new Fruit("无");
            }

        }

    }
}
